
//
//  WindowExtension.swift
//  FoundationsAppCode
//
//  Created by Erickson on 16/3/18.
//  Copyright © 2016年 paiyipai. All rights reserved.
//

import Foundation
import UIKit

extension UIWindow {
    func switchRootViewControll() {
        let version = UserDefaults.standard.string(forKey: "appVersion")
        
        if version == AppConstant.appVersion {
            self.rootViewController = ViewController()
        } else {
            self.rootViewController = ViewController()
            UserDefaults.standard.setValue(AppConstant.appVersion, forKey: "appVersion")
            UserDefaults.standard.synchronize()
        }

    }
}
